<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('接口管理列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label>月份：</label>
                            <input type="text" name="month" id="month" placeholder="yyyy-MM" autocomplete="off" th:value="${month}">
                        </li>
                        <li>
                            <label>表：</label>
                            <input type="text" name="tableName" id="tableName" th:value="${tableName}"/>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var prefix = ctx + "base/etl/check";
    var dbData = [[${@baseDbService.selectAll()}]];
    $(function() {
        var options = {
            url: prefix + "/dayDetail",
            modalName: "天核对明细",
            rowStyle:function (row,index) {
                if(Math.abs(row.diff)>1) {
                    return {css:{"color":'red'}}
                }
                return '';
            },
            columns: [{
                checkbox: true
            },
                {
                    field: 'day',
                    title: '日期'
                },
                {
                    field: 'sour',
                    title: '源'
                },
                {
                    field: 'tar',
                    title: '目标'
                },
                {
                    field: 'diff',
                    title: '差值'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="dataForDiff()"><i class="fa fa-edit"></i>详情</a> ');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });
    function dataForDiff() {
        $.modal.alertWarning("开发中，稍后");
    }
</script>
</body>
</html>